<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        window.onload=function()
        {
            console.log('文档加载结束');
        }
        window.addEventListener('load',function(){
            console.log('文档加载结束 addEventListenter方式')
        })
        window.addEventListener('resize',function(){
            console.log('页面被缩放了 addEventListenter方式');
            console.log('当前窗口大小：'+ window.innerHeight+'x'+window.innerWidth);
        })
         var timer1=setTimeout( function()  {
            console.log('2秒到了');
        }, 2000)
        clearTimeout(timer1)
        var i =0;
        var timer=setInterval( function()  {
            console.log('1秒到了');
            i++;
            if(i>10)
            clearInterval(timer)
        }, 2000);
    </script>
</body>
</html>